<?php

namespace app\model\BbcLogModel;
use app\model\BaseModel\BaseBbcLogModel;

class RequestExceptionLog extends BaseBbcLogModel
{
    protected $table = 'request_exception_log';
    public function addLog( $param = [] ) 
    {
        return $this->create([
            'request_url'           => $param['request_url'],
            'request_method'        => $param['request_method'],
            'request_parameters'    => json_encode($param['request_parameters'],JSON_UNESCAPED_UNICODE),
            'request_ip'            => request()->ip(),
            'response_code'         => $param['response_code'],
            'response_msg'          => $param['response_msg'],
            'response_contents'     => json_encode($param['response_contents'],JSON_UNESCAPED_UNICODE),
            'request_time'          => date("Y-m-d H:i:s"),
        ]);
    }
}